// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import ComponentBase from "../component/ComponentBase";



const { ccclass, property } = cc._decorator;

@ccclass
export default class LoadingBase extends ComponentBase {

    loading: cc.Node = null;


    onLoad(): void {
        super.onLoad();
        // this.runLoadIng();
    }
    start() {
        this.node.x = cc.winSize.width / 2;
        this.node.y = cc.winSize.height / 2;
        // this.runLoadIng();
    }

    protected onEnable(): void {
        this.node.x = cc.winSize.width / 2;
        this.node.y = cc.winSize.height / 2;
        this.runLoadIng();
    }


    runLoadIng() {
        // this.loading.active = true;
        console.log('loading run===================');
        this.loading.stopAllActions();
        this.loading.runAction(cc.rotateBy(1, 270).repeatForever());
    }


    // update (dt) {}
}
